#encoding "utf-8"    
#GRAMMAR_ROOT F

A -> NPAnim;
// описание человека
FIO -> AnyWord<kwtype="fio">;
FirstName -> Word<gram="persn">;
Patronymic -> Word<gram="patrn">;
FOA -> Word<kwtype="adress">;
UW -> AnyWord<~dict, h-reg1>;

SpName -> 'де' UW<rt>; // привязать к файлу с фамильными приставками
SpName -> 'де' Noun<gram="anim,sg", rt>; //странности фамилии
SPName -> FirstName SpName;

Adress -> FOA<nc-agr[1],rt> FirstName<nc-agr[1]> SpName; 
Adress -> FOA<nc-agr[1],rt> FIO<nc-agr[1]>;
Adress -> FOA<rt> UW;
Adress -> FOA<nc-agr[1],rt> SpName<nc-agr[1]>;
Adress -> Noun<gram="anim, sg", nc-agr[1]> FirstName<nc-agr[1]>;
Adress -> Noun<gram="anim, sg", nc-agr[1]> FIO<nc-agr[1]>;
Adress -> FOA<gnc-agr[1]> Word<gnc-agr[1],h-reg1>;
Adress -> FOA 'и' Adress;

Name -> Word<h-reg1> Patronymic;
Name -> FirstName (Patronymic);
Name -> FIO (Name);
Name -> Adress;
Name -> SpName;
Name -> UW;
Name -> FirstName UW;
Name -> Word <gram = "SPRO, sg, 1p">;
Name -> Noun<gram="anim,sg", h-reg1>;
//прилагательное
 
AdjCoord -> (AdvCoord) Word<gram="A"> (AdvCoord);
AdjCoord -> Word<gram="APRO">;
AdjCoord -> AdjCoord AdjCoord+[gnc-agr];
AdjCoord -> AdjCoord<gnc-agr[1]> ',' AdjCoord<gnc-agr[1]>;
AdjCoord -> AdjCoord<gnc-agr[1]> 'и' AdjCoord<gnc-agr[1]>;

Part -> Word<gram="partcp">;
Part -> AdjCoord;
Part -> 'который' <gram="sg">;

PartP -> Comma Part Word* Comma; 
PartP -> Comma Word<gram="PR"> Part Word* Comma;

NPRel -> Noun<kwtype="conn">;
NPRole -> Noun<kwtype="role">;
SingleNoun -> NPRole;
SingleNoun -> NPRel;
SingleNoun -> Name;

N -> Noun;
N -> AdjCoord<gnc-agr[0]> N<gnc-agr[0],rt>;
PP -> Word<gram="PR"> N;
PP -> Word<gram="PR"> Word<gram = "SPRO">;


NP -> SingleNoun;
NP -> AdjCoord<gnc-agr[0]> NP<gnc-agr[0],rt>;
NP -> AdjCoord NP<rt>;
NP -> NP<gram="anim"> PP;


NPAnim -> Name<gram="anim, sg">;
NPAnim -> UW;
NPAnim -> AdjCoord<gnc-agr[0]> NPAnim<gnc-agr[0],rt>;
NPAnim -> AdjCoord NPAnim<rt>;
NPAnim -> NPAnim PP;


NPInterpRoot -> NPRel | NPRole;
NPInterp -> NPInterpRoot interp(Fact.ExRel);
//NPInterp -> NPInterp NP<gram="gen">;
NPInterp -> NPInterpRoot<rt> interp (Fact.ExRel) PP;
NPInterp -> AdjCoord<gnc-agr[0]> NPInterpRoot<gnc-agr[0], rt> interp (Fact.ExRel); 

CompAdv -> Adv<gram="comp">; 
AdvCoord -> Adv;
AdvCoord -> Adv Adv+;
AdvCoord -> AdvCoord ',' AdvCoord;
AdvCoord -> AdvCoord 'и' AdvCoord;

Ger -> (AdvCoord) Word<gram="ger">;
GerP -> Comma Ger Word* Comma;

V -> Verb<kwtype="rel_v">;
V -> Verb<kwtype="being">;
VP -> (AdvCoord) V<rt> (AdvCoord);
VP -> VP<rt> GerP;
VP -> VP PP;
VP -> VR;
VR -> Verb;

CompPhrase -> CompAdv NP<gram="gen">;

BeingSmb -> (Adv) VP<kwtype="being"> NPInterp<kwtype="role", gram="ins"> ;

//F ->"мой" NP <kwtype = "role"> NPAnim;


F -> NPAnim interp (Fact.FPerson) 'и' NPAnim interp (Fact.SPerson) BeingSmb interp (Fact.Rel);
F -> NPAnim interp (Fact.FPerson) '-' NPInterp<kwtype="role"> interp (Fact.Rel) NPAnim<gram="gen"> interp (Fact.SPerson);
F -> NPInterp<kwtype="role"> interp (Fact.Rel) NPAnim<gram="gen"> interp (Fact.SPerson) '-' NPAnim interp (Fact.FPerson) ;
F -> NPInterp<kwtype="conn"> interp (Fact.Rel) Word <gram="PR"> NPAnim interp (Fact.FPerson) 'и' NPAnim interp (Fact.SPerson);
F -> NPAnim<gnc-agr[0]> interp (Fact.FPerson) Comma NPInterp<kwtype="role", gnc-agr[0]> interp (Fact.Rel) NPAnim<gram="gen"> interp (Fact.SPerson);
F -> NPAnim interp (Fact.FPerson) VP<kwtype=rel_v> interp (Fact.Rel) NPAnim<gram="dat"> interp (Fact.SPerson);
F -> NPAnim interp (Fact.FPerson) BeingSmb interp (Fact.Rel) NPAnim interp(Fact.SPerson);
F -> NPInterp<kwtype="conn"> interp (Fact.Rel) NPAnim interp (Fact.FPerson) Word<gram="PR"> NPAnim interp (Fact.SPerson);
F -> NPAnim interp (Fact.SPerson) 'и' NPInterp<kwtype="role", gnc-agr[1]> interp (Fact.Rel) Comma NPAnim<gnc-agr[1]> interp (Fact.FPerson);

F -> NPAnim interp (Fact.FPerson) 'и' NPInterp<kwtype="role", gnc-agr[1]> interp (Fact.Rel) NPAnim<gnc-agr[1]> interp (Fact.SPerson);
F -> NPAnim<sp-agr[0]> interp (Fact.FPerson) VP<sp-agr[0], kwtype="rel_v"> interp (Fact.Rel) Word<gram="PR"> NPAnim interp (Fact.SPerson);
F -> NPAnim<sp-agr[0]> interp (Fact.FPerson) VP<sp-agr[0], kwtype="rel_v"> interp (Fact.Rel) NPAnim interp (Fact.SPerson);
F -> NPAnim interp (Fact.FPerson)  Part<kwtype="rel_adj"> interp (Fact.Rel) Word<gram="PR"> NPAnim interp (Fact.SPerson);  
F -> NPAnim<sp-agr[0]> interp (Fact.FPerson) VP<sp-agr[0], kwtype="rel_v"> interp (Fact.Rel) NPAnim interp (Fact.SPerson) CompPhrase interp (+Fact.Rel);
F -> NPAnim<gram = "gen"> interp (Fact.FPerson) VP<kwtype="being"> NP<kwtype = "role"> interp(Fact.Rel) "по" "имя" Word<h-reg1> interp (Fact.SPerson); 
//F -> NPAnim<sp-agr[0]> interp (Fact.FPerson) VP<sp-agr[0]> (Word<gram = "PR">) NP<kwtype = "role", gnc-agr[1]> interp (Fact.Rel) NPAnim<gnc-agr[1]> interp (Fact.SPerson);
F -> VP <kwtype="rel_v_born">  Word<gram = "PR"> NPAnim interp (Fact.FPerson) NP<kwtype = "role", gnc-agr[1]> interp (Fact.Rel) NPAnim<gnc-agr[1]> interp (Fact.SPerson);


